<?php
$q=$_GET["q"];

$con = mysql_connect('localhost', 'root', '');
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("ProjectDatabase", $con);
$q = json_decode($q);
$sql="SELECT * FROM diagram WHERE diagramname = '".$q[0]."'";


$result = mysql_query($sql);

$row = mysql_fetch_array($result);

echo $row['diagramlink'];
mysql_close($con);
?>
